**Beaulieu and Boulding
**Perceptions of Corruption Paper
** R&R at Governance, resubmitted July 2020


*Tables and Figures for LAPOP section of the results 


** Using Beaulieu&Boulding/Journal Submissions/Governance June 2019/June R&R Resubmission/LAPOP data_Governance .dta"


///CODING VARIABLES -- Skip to models if using small above datasets, use this code from original if needed  

	*First, code corruption vars
	*Recode corruption is common var
	gen corruptcommon=0
	recode corruptcommon 0=1 if exc7==4
	recode corruptcommon 0=2 if exc7==3
	recode corruptcommon 0=3 if exc7==2
	recode corruptcommon 0=4 if exc7==1
	recode corruptcommon 0=. if exc7==.

	recode corruptcommon 0=. if exc7==.a
	recode corruptcommon 0=. if exc7==.b
	recode corruptcommon 0=. if exc7==.c
	
	label var corruptcommon "How common is corruption of public officials? 1=very uncommon"
	
	
	///These questions can be found in the Americas Barometer survey from LAPOP (dc10 and dc13 in the original survey) 
	///and were asked in 2004, 2006, and 2008 in a total of 18 countries). 
	
	codebook dc10 dc13
	
	* Recode scenario corruption questions 
	gen mom_bribecorrupt=.
	recode mom_bribecorrupt .=0 if dc10==0
	recode mom_bribecorrupt .=1 if dc10==1
	recode mom_bribecorrupt .=0 if dc10==2
	recode mom_bribecorrupt .=0 if dc10==3
	
	label var mom_bribecorrupt "Mom pays $5 to clerk to rush birth cert. Corrupt or not?"
	
	gen hirebrothercorrupt =.
	recode hirebrothercorrupt .=0 if dc13==0
	recode hirebrothercorrupt .=1 if dc13==1
	recode hirebrothercorrupt .=0 if dc13==2
	recode hirebrothercorrupt .=0 if dc13==3
	
	label var hirebrothercorrupt "Politician uses influence to hire brother in law. Corrupt or not?" 

	
	*R&R: recode so that "Not corrupt" = 0 and "corrupt and should be punished" and corrupt and justified" = 0 so we have a measure of 
	*perceptions of corruption that is separate from tolerance of corruption 
	
	gen mompays = dc10
	recode mompays (3=0) (2=1) (1=1) 
	label var mompays "Mom pays $5 to clerk to rush birth cert. Corrupt or not, 0/1?"
	
	gen brotherhire= dc13
	recode brotherhire (3=0) (2=1) (1=1) 
	label var brotherhire "Politician uses influence to hire brother in law. Corrupt or not, 0/1?" 
	
	gen int_confclien = confelections*client01
	
////////////////////////////////////////	
///Governance R&R Tables and Figures ////
////////////////////////////////////////

	*Figure 2: Evaluating Scenarios as Corruption
		
		* Model 1
		meqrlogit mompays confelections education quintal polinterest female || pais:, cov(unstr)
		estimates store mompays
	
		* Model 2
		meqrlogit brotherhire confelections education quintal polinterest female || pais:, cov(unstr)
		estimates store brotherhire
	
		* Figure 1: Coefficient Plot 
		coefplot (mompays) (brotherhire) , nolabel  drop(_cons) xline(0) scheme(s2mono) title("Corrupt", span margin(9 6 3 0) size(medlarge)) scale(.85) 

		* Appendix Table 1: full models 1 and 2 
		esttab mompays brotherhire using Table1.rtf, se label title("Table 1: ") mtitle("Scenario 1" "Scenario 2")

	

	
	*  Figure 3: Relationship between being offered food or favors and perceptions of corruption (Fixed Effects) 

		* replicate models on a smaller dataset, to include winner-loser variable (FIXED EFFECTS)  
		*use Beaulieu&Boulding/Journal Submissions/Governance June 2019/June R&R Resubmission/WinnerLoserData.dta"

	
		* Model 3 - direct effect
		ologit corruptcommon education quintal polinterest female winner_loser1 confelections client01 i.pais 
		estimates store a1
	
		
		* Model 4 - Interaction bewteen confidence in elections and clientelism
		ologit corruptcommon education quintal polinterest female winner_loser1 confelections client01 int_confclien i.pais
		estimates store a2 
		
		coefplot (a1, label(Direct Effect) msymbol (T))  (a2, label(Interactive Effect) msymbol (X)), nolabel  drop(_cons) xline(0) keep (education quintall polinterest female confelections client01 winner_loser1  int_confclien) coeflabel (1. education="Education" 2. quintall="Wealth" 3. polinterest="Interest in Politics" 4. female="Gender(female)" 5. confelections="Confidence in Elections" 6. client01= "Offered Food or Favors" 7. c.confelections#client01= "Confidence in Elections X Offered Food or Favor") scheme(s2mono) title("How Common is Public Corruption?", span margin(9 6 3 0) size(medlarge)) scale(.85) name(coeffplotpoor, replace)

		
		esttab a1 a2 using corruptmodels.rtf, replace se label title("Table 1: Multilevel Models of Corruption Perceptions") mtitle("Direct Effect" "Interactive Effect")

	* Figure 4 GRAPH: Graphing Interactions
		ologit corruptcommon education quintal polinterest female winner_loser1 c.confelections#i.client01 i.pais
		margins client01, at(confelections =(1(1)7)) predict (outcome(4))
		marginsplot, recastci(rline) scheme(s2mono) 	
		
	
			
	* 3) Figure 3 
		* Model 3 - direct effect
		meologit corruptcommon education quintal polinterest female winner_loser1 confelections client01 || pais:, covar(unstr) 
		estimates store a1
	
		
		* Model 4 - Interaction bewteen confidence in elections and clientelism
		meologit corruptcommon education quintal polinterest female winner_loser1 c.confelections#client01 || pais:, covar(unstr)
		estimates store a2 
		
		coefplot (a1, label(Direct Effect) msymbol (T))  (a2, label(Interactive Effect) msymbol (X)), nolabel  drop(_cons) xline(0) coeflabel (1. education="Education" 2. quintall="Wealth" 3. polinterest="Interest in Politics" 4. female="Gender(female)" 5. confelections="Confidence in Elections" 6. client01= "Offered Food or Favors" 7. c.confelections#client01= "Confidence in Elections X Offered Food or Favor") scheme(s2mono) title("How Common is Public Corruption?", span margin(9 6 3 0) size(medlarge)) scale(.85) name(coeffplotpoor, replace)

		
		esttab a1 a2 using corruptmodels.rtf, replace se label title("Table 1: Multilevel Models of Corruption Perceptions") mtitle("Direct Effect" "Interactive Effect")

	* 4) Figure 4 
	
		* GRAPH: Graphing Interactions
		meologit corruptcommon education quintal polinterest female winner_loser1 c.confelections#i.client01 
		margins client01, at(confelections =(1(1)7)) predict (outcome(4))
		marginsplot, recastci(rline) scheme(s2mono) 
		


	
			
		
		
///// Appendix Models ///////

*1) Multilevel mixed effects models 

	
	* Model 3 - direct effect
		 meologit corruptcommon education quintal polinterest female confelections client01 || pais:, cov(unstr)
			estimates store a1
	
		
	* Model 4 - Interaction bewteen confidence in elections and clientelism
		meologit corruptcommon education quintal polinterest female c.confelections#i.client01|| pais:, cov(unstr)
			estimates store a2 
		
	coefplot (a1, label(Direct Effect) msymbol (T))  (a2, label(Interactive Effect) msymbol (X)), nolabel  drop(_cons) xline(0)  coeflabel (1. education="Education" 2. quintall="Wealth" 3. polinterest="Interest in Politics" 4. female="Gender(female)" 5. confelections="Confidence in Elections" 6. client01= "Offered Food or Favors" 7. c.confelections#client01=  "Confidence in Elections X Offered Food or Favor") scheme(s2mono) title("How Common is Public Corruption?",  span margin(9 6 3 0) size(medlarge)) scale(.85) name(coeffplotpoor, replace)

		esttab a1 a2 using corruptmodels.rtf, replace se label title("Table 1: Multilevel Models of Corruption Perceptions") mtitle("Direct Effect" "Interactive Effect")

	
	*Figure 3:  Graphing Model 2 Interactions
		meologit corruptcommon education quintal polinterest female c.confelections#i.client01 || pais:, cov(unstr)
		margins client01, at(confelections =(1(1)7)) predict (outcome(4))
		marginsplot, recastci(rline) scheme(s2mono) 

		
	
*2)  Multi-level mixed effects models, with controls for corruption, rule of law, and gdp at country level 
		
			
		* Model 3 - direct effect
		meologit corruptcommon education quintal polinterest female corruption rulelaw gdp confelections client01 || pais:, covar(unstr) 
		estimates store a1
	
		
		* Model 4 - Interaction bewteen confidence in elections and clientelism
		meologit corruptcommon education quintal polinterest female corruption corruption rulelaw gdp c.confelections#client01 || pais:, covar(unstr)
		estimates store a2 
		
		coefplot (a1, label(Direct Effect) msymbol (T))  (a2, label(Interactive Effect) msymbol (X)), nolabel  drop(_cons) xline(0) coeflabel (1. education="Education" 2. quintall="Wealth" 3. polinterest="Interest in Politics" 4. female="Gender(female)" 5. confelections="Confidence in Elections" 6. client01= "Offered Food or Favors" 7. c.confelections#client01= "Confidence in Elections X Offered Food or Favor") scheme(s2mono) title("How Common is Public Corruption?", span margin(9 6 3 0) size(medlarge)) scale(.85) name(coeffplotpoor, replace)

		
		esttab a1 a2 using corruptmodels2.rtf, replace se label title("Table 1: Multilevel Models of Corruption Perceptions") mtitle("Direct Effect" "Interactive Effect")

			GRAPH: Graphing Model 2 Interactions
		meologit corruptcommon education quintal polinterest female  corruption rulelaw gdp c.confelections#i.client01 
		margins client01, at(confelections =(1(1)7)) predict (outcome(4))
		marginsplot, recastci(rline) scheme(s2mono) 	
	

* 3) replicate models on a smaller dataset, to include winner-loser variable 
		*use Beaulieu&Boulding/Journal Submissions/Governance June 2019/June R&R Resubmission/WinnerLoserData.dta"

	*Figure 3 
		* Model 3 - direct effect
		meologit corruptcommon education quintal polinterest female winner_loser1 confelections client01 || pais:, covar(unstr) 
		estimates store a1
	
		
		* Model 4 - Interaction bewteen confidence in elections and clientelism
		meologit corruptcommon education quintal polinterest female winner_loser1 c.confelections#client01 || pais:, covar(unstr)
		estimates store a2 
		
		coefplot (a1, label(Direct Effect) msymbol (T))  (a2, label(Interactive Effect) msymbol (X)), nolabel  drop(_cons) xline(0) coeflabel (1. education="Education" 2. quintall="Wealth" 3. polinterest="Interest in Politics" 4. female="Gender(female)" 5. confelections="Confidence in Elections" 6. client01= "Offered Food or Favors" 7. c.confelections#client01= "Confidence in Elections X Offered Food or Favor") scheme(s2mono) title("How Common is Public Corruption?", span margin(9 6 3 0) size(medlarge)) scale(.85) name(coeffplotpoor, replace)

		
		esttab a1 a2 using corruptmodels.rtf, replace se label title("Table 1: Multilevel Models of Corruption Perceptions") mtitle("Direct Effect" "Interactive Effect")

	*FIGRE 4 
	
		* GRAPH: Graphing Interactions
		meologit corruptcommon education quintal polinterest female winner_loser1 c.confelections#i.client01 
		margins client01, at(confelections =(1(1)7)) predict (outcome(4))
		marginsplot, recastci(rline) scheme(s2mono) 
		

	
*4)		* Model 3 - direct effect
		 ologit corruptcommon education quintal polinterest female confelections client01 i.pais
			estimates store a1
	
		
		* Model 4 - Interaction bewteen confidence in elections and clientelism
		ologit corruptcommon education quintal polinterest female confelections client01 int_confclien i.pais
			estimates store a2 
		
		coefplot (a1, label(Direct Effect) msymbol (T))  (a2, label(Interactive Effect) msymbol (X)), nolabel  drop(_cons) xline(0) keep (education quintall polinterest female confelections client01 int_confclien) coeflabel (1. education="Education" 2. quintall="Wealth" 3. polinterest="Interest in Politics" 4. female="Gender(female)" 5. confelections="Confidence in Elections" 6. client01= "Offered Food or Favors" 7. c.confelections#client01=  "Confidence in Elections X Offered Food or Favor") scheme(s2mono) title("How Common is Public Corruption?",  span margin(9 6 3 0) size(medlarge)) scale(.85) name(coeffplotpoor, replace)

		esttab a1 a2 using corruptmodels.rtf, replace se label title("Table 1: Multilevel Models of Corruption Perceptions") mtitle("Direct Effect" "Interactive Effect")





 * 5) Robustness Check -- paying a bribe
		* Interaction between confidence in elections and paying a bribe 
	
		* Direct Effect
		xtmixed corruptcommon education quintal polinterest female winner_loser1 confelections exc6 || pais:, covar(unstr) 
		estimates store b1
		
		* Interaction 
		xtmixed corruptcommon education quintal polinterest female winner_loser1 c.confelections#exc6 || pais:, covar(unstr)
		estimates store b2

		coefplot (b1, label(Direct Effect) msymbol (T))  (b2, label(Interactive Effect) msymbol (X)), nolabel  drop(_cons) xline(0) coeflabel (1. education="Education" 2. quintall="Wealth" 3. polinterest="Interest in Politics" 4. female="Gender(female)" 5. confelections="Confidence in Elections" 6. exc6= "Asked for a Bribe" 7. c.confelections#exc6= "Confidence in Elections X Asked for a Bribe") scheme(s2mono) title("How Common is Public Corruption?", span margin(9 6 3 0) size(medlarge)) scale(.85) name(coeffplotpoor, replace)
		
		esttab b1 b2 using corruptcommon_bribe.rtf, se label title("Table 1: Multilevel Models of Corruption Perceptions") mtitle("Direct Effect" "Interactive Effect")

			xtmixed corruptcommon education quintal polinterest female winner_loser1 c.confelections#exc6 
			margins exc6, at(confelections =(1(1)7)) 
			marginsplot, recastci(rline) scheme(s2mono) 
			
			

		
		
*** R&R at governance (Spring 2020) 

**adding in some country level measures of actual corruption and election fraud

/// New appendix table 

///  are results robust to inclusion of country level measures of corruptoin and election fraud? (YES, but corruption doesn't predict attitudes about corruptoin) 
	
		xtmixed corruptcommon  corruption education quintal polinterest female client01  || pais:, covar(unstr)
		est store c1

		xtmixed corruptcommon rulelaw education quintal polinterest female  client01 || pais:, covar(unstr)
		est store c2
				
	*** but they are sig. predictors of confidence in elections 
		xtmixed confelections corruption   education polinterest female  client01 || pais:, covar(unstr)
		est store c3
		
		xtmixed confelections rulelaw education  polinterest female client01  || pais:, covar(unstr)
		est store c4 
		
		esttab c1 c2 c3 c4 using countrylevel1.rtf, se label title("Country Level Predictors of Corruption Perceptions and Election Confidence") mtitle("Corruption Common" "Corruption Common" "Election Confidence" "Election Confidence")

		

/// what do people experience more, clientelism, bribes, or elections? 
* descriptive table for R&R

sum client01 exc6 voted protest corruptcommon


/// are results robust to inclusion of winner/ loser variable 		

		
/// Appendix 

*** Summary Stats
sum mompays brotherhire confelections education quintal polinterest female corruptcommon client01 exc6

sort pais
by pais: sum mompays brotherhire confelections education quintal polinterest female corruptcommon client01 exc6 corruption rulelaw gdp
